import React, { Component } from 'react'

export default class App extends Component {
    render() {
        return (
            <div>
                <input />
                <button onClick={() => {
                    console.log("click1", "处理逻辑过多不推荐");
                }}>add1</button>
                <button onClick={this.handlerClick2}>add2</button>
                <button onClick={this.handlerClick3}>add3</button>
                <button onClick={ () => {
                    this.handlerClick4();// 推荐使用
                }}>add4</button>
            </div>
        )
    }
    handlerClick2() {
        console.log("handlerClick2");
    }
    handlerClick3 = () => {
        console.log("handlerClick3");
    }
    handlerClick4 = () => {
        console.log("handlerClick4");
    }
}
